import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SkYueJuPinglunVO, SkYueJuPinglunForm, SkYueJuPinglunQuery } from '@/api/app/SkYueJuPinglun/types';

/**
 * 查询约局评论信息列表
 * @param query
 * @returns {*}
 */

export const listSkYueJuPinglun = (query?: SkYueJuPinglunQuery): AxiosPromise<SkYueJuPinglunVO[]> => {
  return request({
    url: '/app/SkYueJuPinglun/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询约局评论信息详细
 * @param id
 */
export const getSkYueJuPinglun = (id: string | number): AxiosPromise<SkYueJuPinglunVO> => {
  return request({
    url: '/app/SkYueJuPinglun/' + id,
    method: 'get'
  });
};

/**
 * 新增约局评论信息
 * @param data
 */
export const addSkYueJuPinglun = (data: SkYueJuPinglunForm) => {
  return request({
    url: '/app/SkYueJuPinglun',
    method: 'post',
    data: data
  });
};

/**
 * 修改约局评论信息
 * @param data
 */
export const updateSkYueJuPinglun = (data: SkYueJuPinglunForm) => {
  return request({
    url: '/app/SkYueJuPinglun',
    method: 'put',
    data: data
  });
};

/**
 * 删除约局评论信息
 * @param id
 */
export const delSkYueJuPinglun = (id: string | number | Array<string | number>) => {
  return request({
    url: '/app/SkYueJuPinglun/' + id,
    method: 'delete'
  });
};
